<html>
 <head>
  <link href="./leetcode-problem.css" rel="stylesheet" type="text/css">
 </head>
 <body>
  <div class="question_difficulty">
   难度：Medium
  </div>
  <div>
   <h1 class="question_title">
    670. Maximum Swap
   </h1>
   <p>
    Given a non-negative integer, you could swap two digits
    <b>
     at most
    </b>
    once to get the maximum valued number. Return the maximum valued number you could get.
   </p>
   <p>
    <b>
     Example 1:
    </b>
    <br>
   </p>
   <pre>
<b>Input:</b> 2736
<b>Output:</b> 7236
<b>Explanation:</b> Swap the number 2 and the number 7.
</pre>
   <p>
    <b>
     Example 2:
    </b>
    <br>
   </p>
   <pre>
<b>Input:</b> 9973
<b>Output:</b> 9973
<b>Explanation:</b> No swap.
</pre>
   <p>
    <b>
     Note:
    </b>
    <br>
   </p>
   <ol>
    <li>
     The given number is in the range [0, 10
     <sup>
      8
     </sup>
     ]
    </li>
   </ol>
  </div>
  <div>
   <h1 class="question_title">
    670. 最大交换
   </h1>
   <p>
    给定一个非负整数，你
    <strong>
     至多
    </strong>
    可以交换一次数字中的任意两位。返回你能得到的最大值。
   </p>
   <p>
    <strong>
     示例 1 :
    </strong>
   </p>
   <pre>
<strong>输入:</strong> 2736
<strong>输出:</strong> 7236
<strong>解释:</strong> 交换数字2和数字7。
</pre>
   <p>
    <strong>
     示例 2 :
    </strong>
   </p>
   <pre>
<strong>输入:</strong> 9973
<strong>输出:</strong> 9973
<strong>解释:</strong> 不需要交换。
</pre>
   <p>
    <strong>
     注意:
    </strong>
   </p>
   <ol>
    <li>
     给定数字的范围是&nbsp;[0, 10
     <sup>
      8
     </sup>
     ]
    </li>
   </ol>
  </div>
 </body>
</html>